home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / hexbus_cc40_ti74 / Hesbus RS232 user guide.txt < prev    next >
Text File  |  2006-10-19  |  72KB  |  1,715 lines

  1.  
  2.             TABLE OF CONTENTS
  3.  
  4.  
  5.  
  6. TABLE OF CONTENTS
  7.  
  8. Introduction..........................................  1
  9. Set-Up Instructions...................................  2
  10.   Connecting the RS232 Peripheral.....................  3
  11.   Testing the Peripheral..............................  4
  12.   Connecting Devices to the Peripheral................  5
  13. Operating the System..................................  7
  14.   Using  BASIC........................................  7
  15.   Software Options.................................... 14
  16. Recover from Errors................................... 21
  17. Common  Applications.................................. 22
  18.   Output to a printer on the parallel port............ 22
  19.   Exchanging Messages Between a Computer and a Video
  20.     Terminal.......................................... 22
  21. Appendices ........................................... 24
  22.   A. Error Codes...................................... 24
  23.   B. Using Assembly Language.......................... 26
  24.   C. parity Options................................... 31
  25.   D. RS232 Cabling.................................... 32
  26.   E. parallel port Cabling............................ 34
  27. Service  Information.................................. 35
  28.   In Case of Difficulty............................... 35
  29.   Exchange  Centers................................... 36
  30.   If You Have questions or Need Assistance............ 36
  31.  
  32.  
  33. Copyright 1983 Texas Instruments Incorporated
  34.  
  35.                  INTRODUCTION
  36.  
  37.  
  38.  
  39. INTRODUCTION
  40.     The HX-3000 RS232 peripheral is a communications adaptor
  41.     that broadens the range of devices you can attach to
  42.     computers that use the TI HEX-BUS(tm) Intelligent Peripheral
  43.     Interface. This peripheral offers two versatile means of
  44.     connecting devices: the RS232 port and the optional parallel
  45.     port. The RS232 port lets you attach video display terminals,
  46.     modems, plotters, and other devices which follow the EIA
  47.     RS232C serial interface specification. The parallel port is
  48.     available for use with many of the popular computer printers
  49.     built for parallel interfacing.
  50.  
  51.     As part of the expanding line of TI devices that use the HEX-
  52.     BUS interface (a standardized interconnection system with
  53.     uniform set of cabling conventions, control signals, and
  54.     message structures), the RS232 peripheral plugs directly into
  55.     any computer compatible with this interface system.  '
  56.  
  57.     This manual shows you how to connect and test the RS232
  58.     peripheral and presents the BASIC instructions that are used
  59.     to operate it. A description of the software options
  60.     (parameters that may be varied to configure the peripheral 1
  61.     communication with a variety of attached devices) follows
  62.     the section on BASIC. Some common applications of the
  63.     peripheral are given next, followed by a number of useful
  64.     appendices and a section of service information.
  65.  
  66.     Explanations and examples of programming employ the
  67.     version of BASIC developed for the TI Compact Computer
  68.     Model CC-40. Users of other TI computers may note
  69.     differences in format between the BASIC statements shown
  70.     here and equivalent statements as used with their own
  71.     machines. Apart from that distinction, however, the material
  72.     in this manual applies to operation of the peripheral with an
  73.     computer compatible with the HEX-BUS interface.
  74.  
  75.  
  76.   SET-UP INSTRUCTIONS
  77.  
  78.  
  79.  SET-UP INSTRUCTIONS
  80.    Setting up the HX-3000 RS232 peripheral is a simple process
  81.    First the peripheral is attached to the HEX-BUS'  interface.
  82.    Then its operation is tested. This section describes the steps
  83.    involved in each of these procedures. Information about
  84.    connecting other devices to the peripheral is also included.
  85.    Please read the material in this section completely before
  86.    you begin to set up the peripheral.
  87.                       CAUTION
  88.         The electronic components of the RS232
  89.         peripheral can be damaged by discharges of static
  90.         electricity. To avoid damage, do not touch the
  91.         connector contacts or expose them to static
  92.         electricity.
  93.  
  94.    After you have unpacked the RS232 peripheral, you are ready
  95.    to attach it to the HEX-BUS interface. Save the packing
  96.    material for storing or transporting the device.
  97.  
  98.    The devices in the TI HEX-BUS(tm) Intelligent Peripheral
  99.    Interface system have identical eight-pin recessed
  100.    connectors for the cable through which they communicate.
  101.    The computer has one such connector, while each peripheral
  102.    has two of them so that a series of devices may be attached
  103.    to the computer. The first peripheral is plugged directly into
  104.    the computer, the second peripheral is cabled to the first,
  105.    and so on. The last peripheral has one connector free.
  106.  
  107.    You may link devices to the computer in any order. Just plug
  108.    a new section of HEX-BUS interface cable into the available
  109.    connector and plug the other end of the cable into one of the
  110.    connectors on the new peripheral, as described on the next
  111.    page. The plugs are keyed so that you can insert them only
  112.    one way.
  113.  
  114.     Peripherals are normally arranged in a stack next to the
  115.     computer, using the short sections of cable supplied with the
  116.     devices. Longer cables are available separately if you prefer
  117.     to arrange the peripherals differently.
  118.  
  119.  
  120.              SET-UP INSTRUCTIONS
  121.  
  122.  
  123.  
  124. Connecting the RS232 Peripheral
  125. 1. Turn off the computer.
  126. 2. If other peripherals are already attached to the HEX-BUS(tm)
  127.    interface, wait for their activity to cease. Then turn them
  128.    off.
  129. 3. Locate the device having the one available HEX-BUS
  130.    connector (either the last peripheral on the bus, or the
  131.    computer if no peripherals are attached yet). Holding that
  132.    device firmly, plug one end of the cable into the connector.
  133. 4. Place the RS232 peripheral in position and attach the other
  134.    end of the cable to either connector on this unit.
  135. 5. Attach the power cord to the small jack on the back of the
  136.   RS232 peripheral and plug the AC adapter model AC9201
  137.   (included with the peripheral) into a standard 115-vo1t
  138.   outlet. DO NOT CONNECT ANY OTHER ADAPTER TO THIS
  139.   PERIPHERAL.
  140.  
  141.                     CAUTION
  142.      To prevent damage, disconnect all devices before
  143.      moving any part of the HEX-BUS system. The
  144.      cables and connectors which link the computer
  145.      and peripherals are subject to accidental strain if
  146.      not detached. For shipment over long distances
  147.       repack the system securely, preferably in its
  148.      original packing materials.
  149.  
  150.  
  151.  SET-UP INSTRUCTIONS
  152.  
  153.  
  154.  
  155.  Testing the Peripheral
  156.   Note: The following test procedure is used with the CC-40.
  157.   Computers other than the CC-40 may require different test
  158.   procedures from that listed below.
  159.   1. Turn on the RS232 peripheral and any other attached
  160.      peripherals first. Then turn on the computer.
  161.      Note: All peripherals must be turned on for proper
  162.      operation.
  163.   2. Type CALL IO(50,1) and press [ENTER]. The CALL IO
  164.      statement causes the I/O (Input/Output) indicator in the
  165.      computer display and the "working" light on the peripheral
  166.      to turn on for an instant. The message
  167.            I/O error   4   "50"
  168.      should then appear in the display as the ERROR indicator
  169.      comes on. This message tells you that the peripheral is
  170.      functioning correctly.
  171.  
  172.      Note: CALL IO(50,1) is a command to close the parallel port
  173.      The peripheral has just been turned on at this point,
  174.      however, so the port is not yet open. In returning error
  175.      code 4 (device not open), the peripheral is operating as it
  176.      should.
  177.   3. Press [CLR] to clear the error message and restore the
  178.      cursor. The peripheral is now ready for use.
  179.  
  180.   If the light does not come on, the device may not be
  181.   connected properly. Check the cable connections between
  182.   the computer and this peripheral. If a code other than "4" is
  183.   displayed, refer to appendix A.
  184.  
  185.   If the I/O indicator stays on, check that all peripherals are
  186.   powered up. The computer cannot respond to input from the
  187.   keyboard while in this state. Turn the peripheral off
  188.   momentarily to clear the condition. Then check the cable
  189.   connections and try the operational check once more. If the
  190.   malfunction persists, see the In Case of Difficulty section of
  191.   this manual for further assistance.
  192.  
  193.  
  194.           SET-UP INSTRUCTIONS
  195.  
  196.  
  197.  
  198. Connecting Devices to the Peripheral
  199. After the peripheral is connected to the HEX-BUS interface
  200. and tested, additional devices can be attached to the RS232
  201. and parallel ports.
  202.  
  203. The RS232 port is available for both input and output. It is
  204. readily accessible at the back of the peripheral housing, next
  205. to the two eight-pin HEX-BUS connectors. Just plug in the
  206. RS232 cable from the other device.
  207.  
  208. Most devices built according to the Electronic Industries
  209. Association (EIA) RS232C interface standard may be attached
  210. to the RS232 port. To be sure that a given device is
  211. compatible with the peripheral, check its user's manual for
  212. specific variations within the standard. Appendix D contains
  213. information about the RS232 cabling required by this
  214. peripheral.
  215.  
  216. The optional parallel port is provided for output only. It
  217. serves expressly as a connector for the numerous computer
  218. printers that follow the parallel port protocol used in this
  219. peripheral.
  220.  
  221. The parallel port is located inside the peripheral housing.
  222. Peripherals equipped with this option have a permanently-
  223. attached flat cable which passes beneath the RS232
  224. connector and plugs directly to most printers.
  225.  
  226.  
  227. SET-UP INSTRUCTIONS
  228.  
  229.  
  230. Appendix E supplies reference information on the signal and
  231. control lines used in the cable. Check the manual of the
  232. printer you intend to connect to verify the compatibility of
  233. that device with the parallel port.
  234.  
  235. If the Texas Instruments 99/4 Impact Printer Model PHP2500
  236. is used on the parallel port, the RS232 board in the printer
  237. must be removed. Refer to appendix D in the printer manual
  238. (Setting DIP Switches) for instructions on removing the
  239. RS232 board.
  240.  
  241. Note: RS232 peripherals sold without the parallel port option
  242. can be equipped with this feature after purchase as well. If
  243. you wish to have the parallel output capability added at
  244. some point, contact Texas Instruments for further
  245. information. The address and telephone numbers of the TI
  246. Customer Relations Department are found in the If You Have
  247. Questions or Need Assistance section of this manual.
  248.  
  249.  
  250.  
  251.            OPERATING THE SYSTEM
  252.  
  253.  
  254.  
  255. OPERATING THE SYSTEM
  256.      After you have attached a device to the RS232 peripheral,
  257.      you can control the operation of the system from the
  258.      computer keyboard in one of several ways.
  259.      * You can operate peripherals with BASIC statements and
  260.        commands in programs of your own, as described in this
  261.        manual.
  262.      * You can use separately available Solid State Software(tm)
  263.        cartridges which allow you to access peripherals by
  264.        responding to prompts in prewritten programs for
  265.        engineering, science, business, and financial applications
  266.      * If you are using a CC-40 computer equipped with an
  267.        Editor/Assembler cartridge, you can control peripherals in
  268.        assembly language.
  269.  
  270.      Appendix B gives an example of an assembly-language
  271.      application utilizing the RS232 port. For further information
  272.      on the use of Solid State Software or Editor/Assembler
  273.      cartridges with the RS232 peripheral, refer to the manuals for
  274.      those cartridges.
  275.  
  276.   Using BASIC
  277.     The BASIC statements and commands which may be used
  278.     with the RS232 peripheral are summarized below. All of them
  279.     are implemented in the CC-40 computer. The CALL IO
  280.     statement may not be available in other TI computers.
  281.      * LIST-Prints or displays a copy of a program.
  282.      * OPEN, CLOSE-Begin and end the use of a device in a
  283.        program.
  284.      * INPUT, LINPUT, PRINT-Send and receive data. INPUT and
  285.        LINPUT are used only with the RS232 port, not with the
  286.        parallel port.
  287.      * CALL IO-Calls a subprogram which can be used to
  288.        communicate with peripherals. Allows greater control over
  289.        internal details of operations than is otherwise possible in
  290.        BASIC.
  291.      * EOF (End-of-File)-Tests whether a data file being input
  292.        contains additional records to be read. Seldom used with
  293.        this peripheral.
  294.  
  295.     The OPEN statement must precede all of the other
  296.     statements and commands described above except for LIST
  297.     and CALL IO. These two instructions may be used
  298.      independently as well as after OPEN.
  299.  
  300.  
  301. OPERATING THE SYSTEM
  302.  
  303.  
  304.  
  305. Statements and Commands
  306. Statements are BASIC instructions within a program which
  307. are executed when the program is run. Commands are BASIC
  308. instructions outside a program which are executed
  309. immediately. Every instruction belongs to one of these two
  310. categories, though some overlap exists. On the next few
  311. pages the BASIC statements and commands which can be
  312. used with this peripheral are described.
  313.  
  314. The sample formats provided with each description are those
  315. used with the CC-40 computer. Other TI computers
  316. compatible with the HEX-BUS(tm) interface may use slightly
  317. different BASIC formats.
  318.  
  319. The OPEN Statement
  320. The OPEN statement prepares a BASIC program for
  321. communication with peripheral devices. When used with this
  322. peripheral, the OPEN statement links an attached device to
  323. file number and sets functional parameters for the operation
  324. of the RS232 or parallel port. The OPEN statement for this
  325. peripheral has the following general form.
  326.      OPEN #file-number, "device-number [.software-options]
  327.        [, file-attributes]
  328.  
  329. File-number is a numeric expression that evaluates to an
  330. integer between 1 and 255.
  331.  
  332. Device-number is the numeric designation of the peripheral
  333. to be operated. Each peripheral has a number of its own. A
  334. device on the RS232 port may have any number from 20
  335. through 23. Numbers for devices on the parallel port may
  336. range from 50 through 53.
  337.  
  338. Note: The device numbers for this peripheral are factory-set
  339. at 20 for the RS232 port and 50 for the parallel port. You
  340. never need to change them unless you use more than one
  341. RS232 peripheral on the HEX-BUS(tm) interface. If your
  342. applications do require more than one of these peripherals,
  343. write to Texas Instruments Incorporated, RS232 Device
  344. Codes, P.O. Box 53, Lubbock, Texas 79408 for information on
  345. how to alter device numbers.
  346.  
  347.  
  348.        OPERATING THE SYSTEM
  349.  
  350.  
  351.  
  352. Software-options are a set of parameters that you may vary
  353. to match the characteristics of this peripheral to those of
  354. attached devices. If you choose not to vary them, these
  355. parameters automatically assume certain settings called
  356. default values. For further information, consult the Software
  357. Options section of this manual.
  358.  
  359. File-attributes are optional keywords which define certain
  360. features of the data file itself. For attributes not specified,
  361. default values are assumed. These features are described
  362. below.
  363. - File organization-SEQUENTIAL is the only file
  364.   organization which may be used with the RS232 peripheral
  365.   This is the default value and need not be specified in the
  366.   OPEN statement. RELATIVE (random access) files cannot
  367.   be used.
  368. - File type-It is possible for the HEX-BUS(tm) interface
  369.   system to process data either in ASCII (American Standard
  370.   Code for Information Interchange) characters as DISPLAY
  371.   files or in INTERNAL format. The DISPLAY file type,
  372.   however, is more useful in most applications with this
  373.   peripheral. DISPLAY is the default value and need not be
  374.   specified.
  375. - Open mode-This entry determines whether the file may be
  376.   read from (INPUT), written to (OUTPUT), or both (UPDATE).
  377.   If you do not specify an open mode, the default is UPDATE.
  378.   Note: The RS232 port functions in all the above modes, but
  379.   the parallel port must be opened in OUTPUT mode. Neither
  380.   port may be opened in APPEND mode.
  381. - Record type-Records are the blocks of data which make
  382.   up file contents. The HEX-BUS(tm) interface system uses
  383.   VARIABLE records whose length you can define. If no
  384.   length is specified, the RS232 peripheral supplies an
  385.   80-character default. You can set maximum record length
  386.   to either more or fewer than 80 characters by following the
  387.   keyword VARIABLE with a number (as in the first example
  388.   below). This feature is useful when, for instance, a printer
  389.   having a line length of other than 80 characters is attached
  390.   to the RS232 or parallel port.
  391.  
  392.  
  393. OPERATING THE SYSTEM
  394.  
  395.  
  396.  
  397. Examples:
  398. 100 OPEN #l,"20.B=4800",OUTPUT,VARIABLE 132
  399.      Prepares a device on the RS232 port for operation.
  400.      Certain software options or file attributes are specified
  401.      while the rest (by being omitted from the OPEN
  402.      statement) retain their default values. The peripheral is
  403.      opened in DISPLAY format (by default) in OUTPUT
  404.      mode. Record length is set to 132 characters. This
  405.      length is appropriate for a device such as the TI 810
  406.      printer, which can print up to 132 characters per line.
  407.  
  408. 110 OPEN #2,"50", OUTPUT
  409.      Enables a printer on the parallel port for operation.
  410.      OUTPUT is specified because the parallel port must be
  411.      opened in this mode. All other options are left at their
  412.      default values.
  413.  
  414. The term file generally refers to a collection of data stored in
  415. a mass storage device such as the TI Wafertape(tm) peripheral
  416. Although most devices accessible through the RS232
  417. peripheral are display-type equipment not strictly oriented
  418. towards use with files, the word is employed in this manual
  419. for the sake of overall consistency and simplicity.
  420.  
  421.  
  422. The CLOSE Statement
  423. A device enabled for use with an OPEN statement must also
  424. be closed when its use is ended. The CLOSE statement has
  425. the following general form.
  426.      CLOSE #file-number
  427.  
  428. File number is the number specified in the associated OPEN
  429. statement.
  430.  
  431. The INPUT Statement
  432. When you use the INPUT statement with a device connected
  433. to the RS232 port, data can be received from the device and
  434.  assigned to the variables listed in the statement. In this
  435.  application, the INPUT statement has the following general
  436.  form.
  437.        INPUT #file-number, variable-list
  438.  
  439.  
  440.        OPERATING THE SYSTEM
  441.  
  442.  
  443.  
  444. To use the INPUT statement with a device on the RS232 port
  445. you must open the device in INPUT or UPDATE mode. The
  446. amount of data taken depends on the transfer type and
  447. record length established in the associated OPEN statement.
  448. These constraints are detailed in the Software Options
  449. section of the manual, under the heading Transfer Type.
  450.  
  451. Examples:
  452. 200 INPUT #3,B$
  453.      Puts the next character string available from the device
  454.      opened as #3 into the string variable B$.
  455.  
  456. 210 INPUT #5,A,B,C
  457.      Puts the next three values from the device opened as #5
  458.      into variables A, B, and C.
  459.  
  460. See The LINPUT Statement for additional examples.
  461.  
  462. The LINPUT Statement
  463. LINPUT accepts as a single string variable any data received
  464. during an input operation. The format for the LINPUT
  465. statement used with peripherals is as follows.
  466.       LINPUT #file-number, string-variable
  467.  
  468. In contrast to the INPUT statement, LINPUT is unaffected by
  469. punctuation or spaces in the data being accepted-
  470. information is stored exactly as received. The following table
  471. gives examples of the difference between the two
  472. statements.
  473.                    PROGRAM
  474. DATA RECEIVED      SEGMENT          DATA DISPLAYED
  475. "BROWN, CHARLES"   10 INPUT #1,A$   BROWN,  CHARLES
  476.                    20 DISPLAY A$
  477. "BROWN, CHARLES"   10 LINPUT #1,A$  "BROWN,  CHARLES"
  478.                    20 DISPLAY A$
  479. BROWN, CHARLES     10 INPUT #1,A$   BROWN
  480.                    20 DISPLAY A$
  481. BROWN, CHARLES     10 LINPUT #1,A$  BROWN, CHARLES
  482.                    20 DISPLAY A$
  483.        CHARLES     10 INPUT #1,A$   CHARLES
  484.                    20 DISPLAY A$
  485.        CHARLES     10 LINPUT #1,A$         CHARLES
  486.                    20 DISPLAY A$
  487.  
  488.  
  489.  
  490.  
  491.  
  492. OPERATING THE SYSTEM
  493.  
  494.  
  495. The data string "BROWN, CHARLES", put into memory by
  496. INPUT, is displayed as BROWN, CHARLES without quotation
  497. marks. When LINPUT is used, the display matches the
  498. original data. BROWN, CHARLES without quotation marks is
  499. taken by LINPUT as a single string variable. INPUT treats the
  500. comma as a separator and takes this data as two distinct
  501. variables.
  502.  
  503. When CHARLES, preceded by blank spaces, is entered
  504. INPUT takes the blanks as zero input and disregards them.
  505. LINPUT takes them as actual input and reproduces the entire
  506. string, including the blanks.
  507.  
  508. As the examples show, LINPUT has great utility in situations
  509. involving transfers of data with punctuation, such as
  510. passages of text. In such applications you may often find it
  511. more useful than INPUT.
  512.  
  513. Example:
  514. 300 LINPUT #4,L$
  515.      Puts a record's length of data from the device opened
  516.      as #4 into the string variable L$ (assuming a transfer
  517.      type of T = R for "record"). Transfer type is discussed in
  518.      the Software Options section of the manual.
  519.  
  520. Both INPUT and LINPUT take data from the RS232 port.
  521. When used without a file number, both statements also
  522. accept data from the computer console. Neither INPUT nor
  523. LINPUT, however, can be used with the parallel port.
  524.  
  525. The PRINT Statement
  526. To send data from the computer through this peripheral to
  527. another device such as a printer or a display terminal, use
  528. the PRINT statement in either of the formats shown below. A
  529. parallel port device must first be opened in OUTPUT mode,
  530. and an RS232 device must be opened in OUTPUT or UPDATE
  531. mode.
  532.       PRINT #file-number, print-list
  533.       PRINT #file-number, USING {string expression},print-list
  534.                                 {line number      }
  535.  
  536. The optional USING clause specifies the printing or display
  537. format to be used. String-expression defines the format in
  538. the same way as the IMAGE statement (described in the
  539. BASIC reference manual). Line-number refers to the line
  540. number of an IMAGE statement. When used without a file
  541. number, both forms of the PRINT statement place data in
  542. computer display.
  543.  
  544.  
  545.         OPERATING THE SYSTEM
  546.  
  547.  
  548.  
  549. Examples:
  550. 400 PRINT #9,A$
  551.      Sends the value of the variable A$ to the device opened
  552.      as #9.
  553.  
  554. 410 PRINT #9,"HELLO"
  555.      Sends the string HELLO to the device opened as #9.
  556.  
  557. 420 PRINT #9, USING "###.#",357.97
  558.      Outputs the value 358.0 to the device opened as #9.
  559.  
  560. When data is transmitted through the RS232 peripheral to
  561. another device, a carriage return followed by a linefeed
  562. character is sent after each record unless carriage return
  563. software options N or C are set. For a description of the
  564. carriage return and linefeed functions, refer to the section on
  565. the carriage return software option.
  566.  
  567. The LIST Command
  568. The lines of a program in the computer can be sent through
  569. this peripheral for display or printing on another device by
  570. use of the LIST command in the following format.
  571.       LIST  "device-number [.software-options] " [,line-list]
  572.  
  573. No file number is needed; the LIST command opens and
  574. closes the device automatically. Using LIST without
  575. specifying a device number causes the program lines to be
  576. listed in the computer display.
  577.  
  578. Examples:
  579. LIST " 20.B=4800,N=10",10-100
  580.      Causes device 20 (attached to the RS232 port) to list
  581.      lines 10 through 100 of a program stored in the
  582.      computer. Software options needed for a match in
  583.      device characteristics are specified. Those not specified
  584.      remain at their default values.
  585.  
  586. LIST "50"
  587.       Causes an entire program to be printed through the
  588.       parallel port. The software options are left at their
  589.       default values.
  590.  
  591.  
  592. OPERATING THE SYSTEM
  593.  
  594. The EOF Function
  595. BASIC functions are program elements that return a value
  596. after manipulating data, based on parameters given in the
  597. function statements. You can use EOF (end-of-file) when
  598. accepting input from mass storage devices to test whether
  599. the end of a data file has been reached. With devices such
  600. as the Wafertape(tm) peripheral, the value returned by the EOF
  601. function (O or -1) depends on where you are in the file being
  602. read  A -1 denotes the end of a file. A 0 means no end-of-
  603. file.
  604.  
  605. Since the purpose of the RS232 peripheral is not mass
  606. storage, EOF has little application with this device. The value
  607. returned is always 0, indicating that no end-of-file has been
  608. reached.
  609.  
  610. The CALL IO Statement
  611. CALL IO is a BASIC statement used with the CC-40 computer
  612. to access special features and capabilities unique to many
  613. HEX-BUS(Tm) peripherals.
  614.  
  615. The RS232 peripheral supports service requests. With this
  616. peripheral, the most frequent use of CALL lO-other than in
  617. the power-up check-is to enable attached devices to issue
  618. service requests or to disable them from doing so. An
  619. example of this CALL IO application can be found in
  620. appendix B.
  621.  
  622. For further information about the CALL IO statement, consult
  623. the manual for the Editor/Assembler software package.
  624.  
  625. Software Options
  626.  Devices that can be attached to this peripheral differ in how
  627.  quickly they operate, how much data they can handle in a
  628.  given time, and so on. You can compensate for such
  629.  differences by selecting options which are available  as part
  630.  
  631.  of the OPEN statement and the LIST commands in BASIC.
  632.  Because these options are set within programs, or software,
  633.  they are known as software options.
  634.  
  635.  The RS232 peripheral has 12 software options. Ten of these
  636.  options affect the RS232 port, which is available for both
  637.  input and output. The remaining two control the parallel port,
  638.  which can be used only for output.
  639.  
  640.  You can match the operating characteristics of this
  641.  peripheral to those of other devices by indicating desired
  642.  software options in the OPEN statement and in the LIST
  643.  
  644.  
  645.           OPERATING THE SYSTEM
  646.  
  647.  
  648.     command. Since the rest of the BASIC statements and
  649.     commands that control this peripheral operate on previous
  650.     opened files, you do not need to list options with any of
  651.     them-only with OPEN and LIST.
  652.  
  653.     The RS232 peripheral automatically assumes certain preset
  654.     software options, called default values. You only have to
  655.     specify those settings that you wish to change from their
  656.     default values. The tables on the next two pages summarize
  657.     the options, their formats, and their default values.
  658.  
  659.     The software options are described in detail on the pages
  660.     following the tables. Examples of their application occur in
  661.     this section as well as in the COMMON APPLICATIONS
  662.     section and in appendix B. In all examples the formats for
  663.     specifying software options are those used with the CC-40
  664.  
  665.  SOFTWARE OPTIONS (RS232 PORT>
  666.  
  667.     OPTION     DEFAULT FORMAT  SETTINGS
  668.      Baud rate       300       B=      50,75,110,135,150,300,
  669.                                        600,12OO,1800,2400,
  670.                                        3600,4800,7200,9600,
  671.                                        19200
  672.      Data bits         7        D =   *5,6,7,8
  673.      Parity            O        P =    O,E,N,S,M
  674.      Parity check      N        C =    N,Y
  675.      Nulls             0        N =    0-99
  676.      Stop bits         1        S =   *1,2
  677.      Echo              Y        E =    N,Y
  678.      Transfer type     R        T =    R,C,W
  679.      Data overrun      Y        O =    N,Y
  680.      Carriage return   L        R =    N,C,L
  681.      *lf settings D=5 and S=2 are used, the actual number of stop
  682.       bits is 1 1/2.
  683.  
  684.      Note: Several of the above options have equivalent options in
  685.      the RS232 interface designed for the T1-99/4A Home
  686.      Computer. Where such a correspondence exists, the RS232
  687.      software options listed above may be specified either in the
  688.      CC-40 format shown or in the alternate 99/4A format. The
  689.      RS232 options that have this dual-format feature are
  690.      tabulated on the following page.
  691.  
  692.  
  693.    OPERATING THE SYSTEM
  694.  
  695.  
  696. SOFTWARE OPTIONS (PARALLEL PORT>
  697.        OPTION          DEFAULT  FORMAT  SETTINGS
  698.        Carriage return    L       R =   N, C, L
  699.        Strobe level       N       S =   P, N
  700.  
  701.  
  702. RS232 SOFTWARE OPTIONS WITH
  703. ALTERNATE FORMATS
  704.                STANDARD  ALTERNATE
  705.   OPTION        FORMAT    FORMAT      REMARKS
  706.   Baud rate       B =      .BA =
  707.   Data bits       D =      .DA =
  708.   Parity          P =      .PA =
  709.   Parity check    C =      .CH        .CH is equivalent
  710.                                       to C = Y. Tells the
  711.                                       peripheral to
  712.                                       check parity.
  713.  
  714.   Nulls           N =      .NU        .NU is equivalent
  715.                                       to N = 6. Specifies
  716.                                       six null
  717.                                       characters.
  718.  
  719.   Stop bits       S =      .TW        .TW is equivalent
  720.                                       to S = 2. Specifies
  721.                                       two stop bits.
  722.  
  723.   Echo            E =      .EC        .EC is equivalent
  724.                                       to E = N. Turns the
  725.                                       echo feature off.
  726.  
  727.   Carriage return R =      .CR        .CR is equivalent
  728.                                       to R = N. No
  729.                                       carriage return or
  730.                                       linefeed is sent.
  731.  
  732.                            .LF        .LF is equivalent
  733.                                       to R = C. Specifies
  734.                                       carriage return
  735.                                       only - no line feed
  736.                                       is sent.
  737.  
  738.  
  739.         OPERATING THE SYSTEM
  740.  
  741.  
  742.  
  743. Baud Rate
  744. The baud rate is a measure of the speed of data transmission
  745. After it has been set (in an OPEN statement) it remains that
  746. way unless reset in another OPEN statement, or until the
  747. peripheral is turned off. You can choose baud rates of 50, 75
  748. 110, 135, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200,
  749. 9600, and 19200. The rate you choose should match the rate
  750. of the device being used. If you specify the baud rate as
  751. B = 1800, for example, the RS232 port is set up to transfer
  752. data at a rate of 1800 baud. The power-up default is 300. If
  753. you specify a different baud rate, it becomes the new default
  754. until the peripheral is turned off or a new baud rate is
  755. specified.
  756.  
  757. Data bits
  758. The data bits option lets you set the number of bits
  759. contained in each character transmitted. You have a choice
  760. of five, six, seven, or eight bits. If you specify D = 7, then
  761. seven-bit characters are sent. This is the ASCII standard and
  762. the power-up default value. If you set the number of data bits
  763. to 5, 6, or 8, this setting becomes the new default value until
  764. the peripheral is turned off or a different number is specified.
  765.  
  766. Parity
  767. Checking parity is a way of detecting errors in data
  768. transmission. A parity bit can be inserted into each byte of
  769. data sent. It may be either 1 or 0, depending on the type of
  770. parity chosen. This peripheral can check certain types of
  771. parity at the RS232 port. If the type you specify in the OPEN
  772. statement is one of those that can be checked, any loss or
  773. distortion of data during transmission produces an error
  774. indication. The parity options are as follows.
  775. < E for even parity.
  776. < 0 for odd parity.
  777. < S for space parity.
  778. < M for mark parity.
  779. < N for no parity.
  780.  
  781. As an example, specifying P = E for even parity sets the
  782. parity bit in a data byte to 0 if the byte has an even number
  783. of Is and to 1 if the byte has an odd number of Is. Odd
  784. parity is the power-up default. Once the parity is set, it
  785. remains as specified until changed by a new OPEN
  786. statement. The parity types are described in appendix C.
  787.  
  788.  
  789. OPERATING THE SYSTEM
  790.  
  791.  
  792.  
  793. Parity Check
  794. The peripheral can check for odd or even parity at the RS232
  795. port. The parity check option allows you to control the use of
  796. this capability. C = N is the default value. When this setting
  797. is chosen or when no setting is specified, parity is not
  798. checked. Specifying C=Y in an OPEN statement enables the
  799. peripheral to monitor odd or even parity.
  800.  
  801. NULLS
  802. The nulls option determines how many null characters follow
  803. a carriage return character. Nulls are included to give a
  804. printer time to complete its return before it begins printing
  805. characters. You may specify any number from 0 to 99. With
  806. the option N = 7, for instance, seven null characters are sent
  807. after a carriage return. The default value is N =0.
  808.  
  809. Stop bits
  810. Stop bits are sent after transmission of each character to
  811. indicate the end of that character. With the stop bits
  812. software option, you can set the number of stop bits to
  813. either 1 or 2. The setting S=2, for example, causes this
  814. peripheral to end each transmission with two stop bits. The
  815. default value is S = 1. Note that if the settings D = 5 and S = 2
  816. are used, the actual number of stop bits is 1 1/2.
  817.  
  818. Echo
  819. The echo software option provides an additional method of
  820. detecting errors in transmission of data from a Peripheral
  821. device through the RS232 port to the computer. The RS232
  822. peripheral can be instructed to retransmit characters, as it
  823. receives them, back to the sending device. You can select
  824. E=Y to have characters echoed back to the sending device
  825. or E = N to prevent them from being echoed back. The default
  826. is E = Y.
  827.  
  828. Transfer Type
  829. Incoming data is temporarily stored at the RS232 port. The
  830. transfer type software option determines the form in which
  831. data is moved from the port to the computer.
  832.  
  833. Option T = R, the default setting, sends input to the computer
  834. in records of the length established in the associated OPEN
  835. statement. If VARIABLE 15 is specified, for example, data is
  836. transferred in records 15 characters long. This feature is
  837. useful in applications that involve data received in records of
  838. some consistent length.
  839.  
  840.  
  841.           OPERATING THE SYSTEM
  842.  
  843.  
  844.  
  845. Should a carriage return end the data stream before a record
  846. is complete, the record goes to the computer with the
  847. remainder of its length padded by blank spaces. An entire
  848. record's length of blanks is sent to the computer if a carriage
  849. return is the first character input with option T = R.
  850.  
  851. If the data transmission itself has a series of trailing blanks
  852. between the carriage return and the end of the actual data,
  853. the user's choice of input statement determines how the
  854. blanks are handled. INPUT removes trailing blanks. LINPUT
  855. preserves them as part of the data.
  856.  
  857. Option T = C transfers data character by character. Within
  858. limits, any characters stored in the peripheral at the time of
  859. an input operation (including carriage returns and linefeeds)
  860. are sent to the computer. The limits are set by the record
  861. length specified in the OPEN statement and by the number
  862. of characters in the peripheral: the lower of these two figures
  863. is the number of characters transferred. If no data is
  864. available, a null data string is set to the computer and the
  865. program continues.
  866.  
  867. Option T=W also transfers data character by character. As
  868. long as data is in the peripheral there is no difference
  869. between this option and option T = C, but when no data is
  870. available the RS232 port causes the computer to wait until a
  871. character is ready.
  872.  
  873. Setting the transfer type to T = C, for example, allows
  874. sending as many characters as are stored at the port, up to
  875. the specified record length, to the computer.
  876.  
  877. Data Overrun
  878. A data overrun occurs when the RS232 port receives more
  879. data than it can send on to the computer. Any additional
  880. data that arrives during an overrun is lost. Use the data
  881. overrun option to specify whether you wish the peripheral to
  882. report data overrun as an error.
  883.  
  884. Choosing the option 0 = N causes the peripheral to disregard
  885. data overruns  When you are receiving data through the
  886. RS232 port from a device such as a video terminal, this
  887. setting allows the incoming data stream to overflow the port
  888. without producing an error indication and stopping the
  889. program. Characters lost during an overrun are not echoed
  890. back to the sending device, regardless of the echo option
  891. setting.
  892.  
  893.  
  894. OPERATING THE SYSTEM
  895.  
  896.  
  897.  
  898. Selecting the option O=Y (which is the default value) allow
  899. a data overrun error to stop a program. This feature is helpful
  900. when the loss of even a small amount of data would make
  901. the rest of a transmission useless.
  902.  
  903. Carriage Return
  904. The carriage return option allows the peripheral to regulate
  905. the carriage operation of a printing or display device
  906. connected to the RS232 port. The peripheral can be directed
  907. either to send an automatic linefeed and carriage return (or
  908. just a carriage return) at the end of each record, or to
  909. suppress those characters.
  910.  
  911. The carriage return sends the print head or cursor of the
  912. attached device back to the starting point. The linefeed
  913. character causes the paper or display to advance by one
  914. The options are as follows.
  915. * R = L for carriage return and linefeed.
  916. * R = C for carriage return only.
  917. * R = N for no carriage return or linefeed.
  918.  
  919. Selecting the option R = C, for example, means that each
  920. record sent from the peripheral is followed by a carriage
  921. return but not by a linefeed. The default value is L. These
  922. details apply equally to the parallel port carriage return
  923. option, which has the same selections and default.
  924.  
  925. Carriage Return (Parallel Port)
  926. The carriage return option for the parallel port works in the
  927. same way as the carriage return option for the RS232 port.
  928. determines whether the peripheral sends or suppresses an
  929. automatic linefeed and carriage return (or carriage return
  930. only) at the end of each record. The options and default are
  931. identical to those of the RS232 port.
  932.  
  933. Strobe Level (Parallel Port)
  934. A strobe is a control signal used in data transfers. Some
  935. printers which can be connected to the parallel port require
  936. positive strobes, while others use negative strobes (both
  937. described in appendix E). The strobe level software option
  938. lets you select which level to use with a given printer. The
  939. setting S = P in an OPEN statement produces a positive
  940. strobe. S = N (which is the default value) produces a negative
  941. strobe. Consult the user's manual of the printer you intend
  942. connect for the proper strobe level.
  943.  
  944.  
  945.             RECOVERY FROM ERRORS
  946.  
  947.  
  948.  
  949. RECOVERY FROM ERRORS
  950.     Most errors that involve the RS232 peripheral occur during
  951.     input or output with this device as a result of some
  952.     discrepancy in program statements. These errors are seldom
  953.     serious, and they are easily remedied. Errors are normally
  954.     indicated to the operator in the form of a displayed message
  955.     beginning I/O error... which includes a one- to three-digit
  956.     error code and the device or file number of the port
  957.     concerned. If the error occurs during execution of a program
  958.     any open files are automatically closed. The error codes that
  959.     you may encounter with this peripheral are listed in append
  960.     A with their meanings and recommended corrective steps.
  961.  
  962.     In the event of such an error, first note the code number and
  963.     look it up in appendix A. Next clear the fault indication and
  964.     restore the cursor by pressing [CLR]. Then try the operation
  965.     again, following the suggestions given in the appendix for
  966.     that error.
  967.  
  968.     If the above measures do not solve the problem, turn the
  969.     peripheral off briefly and try once more. If the malfunction
  970.     persists, turn the computer off momentarily and try again.
  971.     Successive attempts that produce the same error may
  972.     indicate a hardware fault. Consult the in Case of Difficulty
  973.     section of this manual for service information and additional
  974.     troubleshooting suggestions.
  975.  
  976.  
  977.  
  978.  
  979.     COMMON APPLICATIONS
  980.  
  981.  
  982.  
  983. COMMON APPLICATIONS
  984.      The RS232 peripheral lets you operate your computer with
  985.      wide range of devices beyond those in the standard group
  986.      HEX-BUS(tm) peripherals. Two examples are given here. The
  987.      first shows how data can be sent from the computer to a
  988.      printer on the parallel port, and the second illustrates how
  989.      you can use the computer to communicate with a video
  990.      display terminal on the RS232 port.
  991.  
  992.    Output to a Printer on the Parallel Port
  993.      In this example, seven character strings are read from data
  994.      statements at the end of the program and printed.
  995.          100 DIM A$(7)
  996.          200 FOR P=1 TO 7:READ A$(P)
  997.          300 NEXT P
  998.          400 OPEN #23,"50", OUTPUT
  999.          500 FOR S=1 TO 7:PRINT #23,A$(S)
  1000.          600 NEXT S
  1001.          700 CLOSE #23
  1002.          800 DATA "MONDAY","TUESDAY","WEDNESDAY", "THURSDAY"
  1003.          900 DATA "FRIDAY", "SATURDAY", "SUNDAY"
  1004.  
  1005.      Lines 100-300 set up an array and read in the data. Line 400
  1006.      assigns file number 23 to device number 50, a printer on the
  1007.      parallel port. The port is opened for OUTPUT. Because no file
  1008.      type is specified, DISPLAY is assigned by default and the
  1009.      attached printing device receives data in ASCII format.
  1010.      Carriage return setting L, also selected automatically, sends
  1011.      both a carriage return and a linefeed character to the printer
  1012.      at the end of each record. In lines 500 and 600 a PRINT loop
  1013.      is executed seven times. Each character string is printed on
  1014.      a separate line.
  1015.  
  1016.      If the printer is off-line when the PRINT loop is executed, the
  1017.      RS232 peripheral holds the data ready and waits. After all the
  1018.      lines are printed, the device is closed.
  1019.  
  1020.    Exchanging Messages Between a
  1021.    Computer and a Video Terminal
  1022.      The following program can be used in a HEX-BUS(tm) system
  1023.      with a video display terminal connected to the RS232 port.
  1024.      The program first accepts a message from the computer and
  1025.  
  1026.  
  1027.        COMMON APPLICATIONS
  1028.  
  1029.  
  1030. transmits it to the terminal. The terminal user is then
  1031. prompted to enter a message which is sent to the computer
  1032. display. The exchange of messages can continue for as long
  1033. as the program is run.
  1034.  
  1035.      100 OPEN #1,"20.B=4800,0=N,R=N,C=Y,P=O,D=7",
  1036.          DISPLAY, UPDATE
  1037.      200 INPUT "TYPE MESSAGE: ";X$
  1038.      300 PRINT #1,"MESSAGE FROM COMPUTER:
  1039.          ";X$;CHR$(10);CHR$(13)
  1040.      400 PRINT #1,"TYPE MESSAGE: "
  1041.      500 INPUT #1,X$
  1042.      600 PRINT #1,CHR$(10)
  1043.      700 PRINT "MESSAGE FROM TERMINAL: ";X$
  1044.      800 PAUSE
  1045.      900 GOTO 200
  1046.  
  1047. Line 100 opens file number 1 for the RS232 port and defines
  1048. a number of parameters for operation-baud rate,
  1049. management of data overruns, carriage return and linefeed
  1050. setting, parity check, parity type, number of data bits, file
  1051. type, and open mode. More details on these parameters can
  1052. be found in the USING BASIC section. They are set up to
  1053. match the operating characteristics of the RS232 peripheral
  1054. to those of the terminal.
  1055.  
  1056. Line 200 prompts the computer user to type a message and
  1057. puts it into the string variable X$. Line 300 sends the
  1058. message to the terminal, where it is displayed with the
  1059. introductory words MESSAGE FROM COMPUTER:. Both of these
  1060. items are displayed on the same line.
  1061.  
  1062. In lines 400 and 500, the terminal user is prompted to type
  1063. message which is sent back to the computer. So that the
  1064. terminal user's prompt and message do not appear on the
  1065. same line as the computer user's, carriage return and
  1066. linefeed characters-CHR$(13) and CHR$(10)-are inserted
  1067. after the message from the computer in line 300.
  1068.  
  1069. In line 600, a linefeed character is sent to the terminal so
  1070. that the next message from the computer does not erase the
  1071. terminal user's current message from his display. Lines 700
  1072. and 800 place the terminal user's message in the computer
  1073. display. The PAUSE instruction holds the message in the
  1074. computer display until the computer user presses the [ENTER]
  1075. key to resume the exchange.
  1076.  
  1077.     APPENDICES
  1078.  
  1079.  
  1080.  
  1081. APPENDIX A: ERROR CODES
  1082.      Listed below are the error codes related to the operation o
  1083.      the RS232 peripheral in BASIC programs.
  1084.  
  1085.      The error codes marked with an asterisk (*) are those that
  1086.      apply only if you use the CALL IO instruction. They do not
  1087.      occur with any other BASIC statements or commands.
  1088.    CODE  MEANING
  1089.      0*   NO ERRORS.
  1090.      1     DEVICE/FILE OPTIONS ERROR. Check the software
  1091.            options in the OPEN statement or IO call. Make sure
  1092.            that commas, periods and equal signs are used
  1093.            correctly.
  1094.      2     ERROR IN ATTRIBUTES. Check the file attributes
  1095.            given in the OPEN statement or IO call.
  1096.      4     DEVICE/FILE NOT OPEN. Open the device before
  1097.            using it.
  1098.      5     DEVICE/FILE ALREADY OPEN. Close the device an
  1099.            try again. If the CLOSE statement in BASIC does n
  1100.            work, use CALL IO(20,1) to close the RS232 port or
  1101.            CALL IO(50,1) to close the parallel port. If the above
  1102.            steps are not successful, you can close all
  1103.            peripherals by turning the computer off momentarily
  1104.      8*    DATA/FILE TOO LONG. Modify the Peripheral Access
  1105.            Block.
  1106.     10*    NOT REQUESTING SERVICE. This message may be
  1107.            sent by a peripheral in response to a poll by the
  1108.            computer to determine which device issued a service
  1109.            request.
  1110.     12*    BUFFER SIZE ERROR. The data buffer size specified
  1111.            in the Input/Output subsystem instructions is not
  1112.            large enough for the data returned by a peripheral.
  1113.            Make the buffer larger.
  1114.     13     UNSUPPORTED COMMAND. The peripheral
  1115.            generates this message in response to commands
  1116.            that it can not accept.
  1117.     14     DEVICE/FILE NOT OPEN FOR OUTPUT. The
  1118.            peripheral's current open mode does not allow you
  1119.            send data. Reopen the device in OUTPUT (either port)
  1120.            or UPDATE (RS232 port) mode.
  1121.  
  1122.  
  1123.                 APPENDICES
  1124.  
  1125.  
  1126.     15    DEVICE/FILE NOT OPEN FOR INPUT. The
  1127.           peripheral's current open mode does not allow you
  1128.           receive data. Reopen the RS232 port in INPUT or
  1129.           UPDATE mode.
  1130.     17    RELATIVE FILES NOT SUPPORTED. The RS232
  1131.           peripheral can only process SEQUENTIAL files.
  1132.     19    APPEND MODE NOT SUPPORTED. This peripheral
  1133.           cannot operate in the APPEND mode. It must be
  1134.           opened in INPUT, OUTPUT, or UPDATE mode,
  1135.           depending on its application in a given program.
  1136.     21    INPUT MODE NOT SUPPORTED. The peripheral
  1137.           returns this message if you try to open the parallel
  1138.           port in the INPUT mode. The port is provided
  1139.           specifically for output to printers. It must be opened
  1140.           in the OUTPUT mode.
  1141.     22    UPDATE MODE NOT SUPPORTED. The peripheral
  1142.           returns this message if you try to open the parallel
  1143.           port in the UPDATE mode. Use the OUTPUT mode.
  1144.     80    DATA OVERRUN. Data is arriving at the RS232 port
  1145.           faster than it can be sent on to the computer. Input
  1146.           more frequently to save data, or set the overrun
  1147.           software option to 0 = N to ignore the loss of data.
  1148.     81    PARITY ERROR. Indicates either that a data
  1149.           transmission error has occurred or that the parity
  1150.           settings of the RS232 port and the attached device
  1151.           do not match. Check that the parity settings are the
  1152.           same.
  1153.     82    FRAMING ERROR. A disparity exists between the
  1154.           data bits, stop bits, baud rate, or parity software
  1155.           option settings of the RS232 port and the
  1156.           characteristics of the attached device. Be sure that
  1157.           these settings match the device characteristics.
  1158.     83    FRAMING AND PARITY ERRORS. A combination of
  1159.           errors 81 and 82 is occurring. Correct the problem as
  1160.           described above.
  1161.    255    TIME-OUT ERROR. The computer generates this error
  1162.           code if it cannot communicate with a peripheral.
  1163.           Check the HEX-BUS cable connections and make
  1164.           sure that you are using the correct device-number.
  1165.  
  1166.  
  1167.   APPENDICES
  1168.  
  1169.  
  1170.  
  1171. APPENDIX B: USING ASSEMBLY LANGUAGE
  1172.    This appendix is primarily for use in conjunction with the
  1173.    Editor/Assembler manual and software package created for
  1174.    the CC-40 computer and its peripherals. The descriptions and
  1175.    sample application given here supplement the explanations
  1176.    and examples found in the Editor/Assembler manual.
  1177.  
  1178.    The CC-40 has an Input/Output subsystem which you can
  1179.    access to communicate with HEX-BUS(tm) peripherals on an
  1180.    assembly-language level. This communication can take place
  1181.    either entirely in assembly language if you have the
  1182.    Editor/Assembler cartridge, or from BASIC if you use the
  1183.    CALL IO instruction with appropriate command codes.
  1184.  
  1185.   Command Codes
  1186.    The devices that you can attach to the RS232 peripheral are
  1187.    essentially display-type devices, not oriented toward use with
  1188.    files. The commands affecting this peripheral involve the
  1189.    basic functions of opening or closing devices and reading or
  1190.    writing data. (The RS232 port also supports service requests.)
  1191.    The assembly-language command codes with which you can
  1192.    direct the RS232 peripheral to carry out these tasks are Iisted
  1193.    below together with any applicable restrictions.
  1194.      0  Open. Prepares a device for use. The APPEND mode
  1195.         and RELATIVE file type cannot be used with either port
  1196.         of the peripheral. The UPDATE and INPUT modes can
  1197.         be used only with the RS232 port.
  1198.      1  Close. Completes any pending operations by a device
  1199.         and ends the use of the device until the next open
  1200.         instruction.
  1201.      3  Read. Inputs data from a peripheral device. The read
  1202.         command can be used with the RS232 port, but not
  1203.         with the parallel port. The attached device must first be
  1204.         opened in INPUT or UPDATE mode.
  1205.      4  Write. Sends data to a peripheral device. The write
  1206.         command can be used with both ports of this
  1207.         peripheral. The parallel port must first be opened in
  1208.         OUTPUT mode and the RS232 port in OUTPUT or
  1209.         UPDATE mode.
  1210.      7  Return Status. Used in requesting device and file status
  1211.         information from peripherals. When this message is
  1212.         used with the RS232 peripheral, the end-of-file flag is
  1213.         always returned set to zero.
  1214.  
  1215.  
  1216.                    APPENDICES
  1217.  
  1218.  
  1219.      8  Enable Service Requests. Signals a peripheral device
  1220.         that it may issue service requests to the computer. This
  1221.         command is used only with the RS232 port since the
  1222.         parallel port cannot send messages to the computer.
  1223.         The next section of this appendix contains further
  1224.         details.
  1225.      9  Disable Service Requests. Signals a peripheral device
  1226.         that it may no longer request service. This instruction
  1227.         can be used only with the RS232 port.
  1228.         Service Request Poll. Not used in programming, but
  1229.         automatically sent to peripherals by the computer upon
  1230.         reception of a service request. Determines which device
  1231.         is requesting service.
  1232.     15  Set Options. Modifies the peripheral options previously
  1233.         specified in an open instruction without first closing
  1234.         and reopening the device.
  1235.     16  Transmit Break. Causes the RS232 peripheral to send a
  1236.         continuous break signal for approximately .25 seconds.
  1237.         Used in data communications to shift between
  1238.         operating modes.
  1239.    254  Null Operation. Not used in programming, but
  1240.         automatically sent by the computer in response to any
  1241.         service requests received while a previous request is
  1242.         being processed. Though the computer may enable a
  1243.         number of peripherals for service requests, it can
  1244.         process only one request at a time.
  1245.    255  Reset Bus. Not normally included in programs, but
  1246.         allows the user to close all open device files and reset
  1247.         all peripherals attached to the computer.
  1248.  
  1249.  For a detailed treatment of the Input/Output subsystem and
  1250.  command codes, refer to the manual for the Editor/Assembler
  1251.  cartridge.
  1252.  
  1253.  
  1254.  Service Requests
  1255.   Many HEX BUS(tm) peripherals have unique capabilities which
  1256.   are accessible on an assembly-language level. The RS232
  1257.   peripheral can be enabled for service requests. It then has
  1258.   the ability to interrupt regular program execution and have
  1259.   data processed by the computer.
  1260.  
  1261.  
  1262.  
  1263. APPENDICES
  1264.  
  1265.  
  1266.  This peripheral, when enabled, issues a service request to
  1267.  the computer whenever data from the attached device
  1268.  appears at the RS232 port. The peripheral is enabled for
  1269.  service requests as follows.
  1270.  1. Set up a Service Request Peripheral Access Block
  1271.     (SRPAB).
  1272.  2. Enable interrupts.
  1273.  3. Open the device.
  1274.  4. Send the enable service requests instruction.
  1275.  The above steps are executed most efficiently in assembly
  1276.  language, as described in the Editor/Assembler manual. With
  1277.  somewhat reduced efficiency, they can also be performed in
  1278.  BASIC. Since assembly-language programming is not within
  1279.  the scope of this manual, a BASIC example is given  ere.
  1280.  The SRPAB, set up in computer memory by the user, supplies
  1281.  the parameters necessary for communication with the RS232
  1282.  peripheral through the Input/Output subsystem. It contains
  1283.  the one- or two-byte fields diagrammed below, which are
  1284.  filled as needed for each particular application. The diagram
  1285.  shows an SRPAB that allows service requests from a device
  1286.  on the RS232 port.
  1287.                            SRPAB$
  1288. Device number                20                      RS232 port
  1289. Command code                  0                      Don't care
  1290. Logical unit number (LUNO)    0                      Don't care
  1291. Record number                 0                      Don't care
  1292.                               0
  1293. Buffer length                10             Size of allocated buffer
  1294.                               0
  1295. Data length                   0             Not sending any data
  1296.                               0
  1297. Returned status               0                     Zeroed initially
  1298. Buffer pointer               LSB        Points to highest address
  1299.                              MSB                        in buffer
  1300. Link to next SRPAB           LSB2    Points to start of this SRPAB
  1301.                              MSB2       (No other device enabled)
  1302. Service flag                  0                     Zeroed initially
  1303. Pointer to device service     0                          Left zeroed
  1304. routine (DSR)                 0
  1305.  
  1306.  
  1307.                      APPENDICES
  1308.  
  1309.  
  1310. As the diagram indicates, the elements that must be
  1311. specified in building a Service Request PAB for the RS232
  1312. peripheral are the device number, buffer length, data length,
  1313. return status, buffer address, SRPAB pointer, service flag,
  1314. and device service routine (DSR) pointer. The field for the
  1315. DSR pointer is provided for future applications. It is not used
  1316. in the CC-40 and should be left zeroed as shown.
  1317.  
  1318. Data is entered in the fields of an SRPAB with the POKE
  1319. subprogram. The necessary values are placed in memory
  1320. starting at the lowest address allocated. The following
  1321. program segment illustrates the four-stage process of
  1322. enabling the RS232 peripheral for service requests, beginning
  1323. with the construction of an SRPAB.
  1324.      100 CALL GETMEM (17,SRPABADDR)  ! Gets SRPAB
  1325.      110 CALL GETMEM (10,BUFFADDR)  ! Gets buffer
  1326.      120 CALL SPLIT (BUFFADDR+9,MSB,LSB)! Builds SRPAB
  1327.      130 CALL SPLIT (SRPABADDR+16,MSB2,LSB2)
  1328.      140 CALL POKE (SRPABADDR,0,0,0,MSB2,LSB2,MSB,LSB,0,
  1329.          0,0,0,10,0,0,0,0,20)
  1330.      150 CALL POKE (2056,MSB2,LSB2) !Sets up pointer to
  1331.          SRPAB
  1332.      160 CALL POKE (BUFFADDR,5,10)  ! Enables interrupts
  1333.      170 CALL EXEC (BUFFADDR)
  1334.      180 CALL PEEK (256,IOCNTRL)
  1335.      190 IOCNTRL=IOCNTRL OR 1
  1336.      200 CALL POKE (256,IOCNTRL)
  1337.      210 OPEN #1,"20.B=9600,C=Y,P=E,D=7,E=Y,T=C",
  1338.          VARIABLE 10
  1339.      220 CALL IO(20,8) !Sends enable service requests
  1340.          command
  1341.  
  1342. lines 100-140 above prepare memory space for the SRPAB
  1343. and the data buffer. line 150 sets up a pointer to the SRPAB
  1344. for the I/O subsystem. In lines 160-200, interrupts are enabled
  1345. so that the computer can recognize service requests. In line
  1346. 210 the peripheral is opened, as required before enabling
  1347. service requests. The enable service requests command is
  1348. sent in Line 220.
  1349. The SPLIT subprogram which is called in lines 120 and 130
  1350. splits a 16-bit unsigned data value into a Most Significant
  1351. Byte (MSB) and a least Significant Byte (LSB), as shown
  1352. below.
  1353.      1000 SUB SPLIT (DATAVAL,MSB,LSB)
  1354.      1010 MSB=INT(DATAVAL/256)
  1355.      1020 LSB=DATAVAL-MSB*256
  1356.      1030 SUBEND
  1357.  
  1358.  
  1359. APPENDICES
  1360.  
  1361.  
  1362. After a device is enabled for service requests, a program can
  1363. check for received data by testing the service flag in the
  1364. SRPAB as shown below. The 110 subsystem sets the service
  1365. flag upon completion of a successful poll.
  1366.     230 CALL PEEK (SRPABADDR+2,SERVICE_FLAG)
  1367.     240 IF SERVICE_FLAG<>0 THEN 700
  1368.     250 GOTO 230
  1369.  
  1370. If the service flag check indicates no reception of data, the
  1371. main program continues immediately after line 240. If the
  1372. service flag is set, however, execution of the main program
  1373. halts and the program branches to line 700. At line 700 the
  1374. operation status is checked. Data is then removed and
  1375. processed.
  1376.      700 CALL PEEK (SRPABADDR+7,STATUS)
  1377.      710 IF STATUS THEN PRINT
  1378.      " Error-- "; STATUS: PAUSE: STOP
  1379.      720 CALL PEEK (SRPABADDR+8,MSB,LSB)!Gets data length
  1380.      730 DATLEN=MSB*256+LSB !MSB should always be zero
  1381.      740 DATA$= ""  !Initializes data string
  1382.      750 FOR I=1 TO DATLEN
  1383.      760 CALL PEEK (BUFFADDR+10-I,A)! Gets next character
  1384.      770 DATA$=DATA$&CHR$ (A)!Appends it to the string
  1385.      780 NEXT I
  1386.      790 PRINT DATA$
  1387.      800 PAUSE
  1388.  
  1389. The number of characters transferred during each service
  1390. request depends on the buffer length and transfer mode
  1391. established in the OPEN command. If the option T = R is
  1392. specified, then a full record of data (or data padded with
  1393. blanks) having the length of the buffer is sent. If the record
  1394. is not complete when the computer polls the RS232 port, the
  1395. peripheral causes the computer to wait until it is complete.
  1396. the options T = C or T = W are chosen, any number of
  1397. characters up to the buffer length may be transferred.
  1398.  
  1399. Until the SRPAB service flag is reset to zero by the program,
  1400. any additional service requests are disregarded. The
  1401. peripheral requesting service continues doing so until its
  1402. request is acknowledged.
  1403.  
  1404. If the computer transmits an input instruction to a peripheral
  1405. issuing a service request, the service request is terminated
  1406. and the peripheral sends the required data instead. Data can
  1407. also be output to devices enabled for service requests. These
  1408. operations are executed as usual.
  1409.  
  1410.  
  1411.  
  1412.  
  1413.                        APPENDICES
  1414.  
  1415.  
  1416.  
  1417. APPENDIX C: PARITY OPTIONS
  1418.    Listed and defined below are the parity options available to
  1419.    you in data transmissions with the RS232 peripheral. This
  1420.    peripheral checks for even and odd parity.
  1421.         E    Even parity. If a data byte in the transmission
  1422.              contains an odd number of 1s, its parity bit
  1423.              becomes 1. If the data byte has an even number of
  1424.              1s, its parity bit becomes 0.
  1425.         O    Odd parity. If a data byte in the transmission has
  1426.              an even number of 1s, its parity bit is set to 1.
  1427.              Otherwise, its parity bit is set to 0.
  1428.         S    Space parity. If you specify space parity, the parity
  1429.              bit is always 0 regardless of whether the data byte
  1430.              contains an even or odd number of 1s.
  1431.         M    Mark parity. The parity bit is always 1.
  1432.         N    No parity. The data transmission does not contain
  1433.              a parity bit.
  1434.  
  1435.  
  1436.     APPENDICES
  1437.  
  1438.  
  1439.  
  1440. APPENDIX D: RS232 CABLING
  1441.      Cables used to connect other computers, calculators,
  1442.      modems, or terminals to the RS232 port must have EIA
  1443.      RS232C 25-pin male connectors. Some electronic devices
  1444.      built according to the RS232C standard use nearly all the
  1445.      available lines, while other devices require fewer
  1446.      connections. This peripheral utilizes the nine pins listed
  1447.      below.
  1448.         PIN    SIGNAL               DIRECTION
  1449.          1   Frame ground             -----
  1450.          2   Serial data in         To HX-3000 RS232 port
  1451.          3   Serial data out        From HX-3000 RS232 port
  1452.          4   Request to send        To HX-3000 RS232 port
  1453.          5   Clear to send          From HX-3000 RS232 port
  1454.          6   Data set ready         From HX-3000 RS232 port
  1455.          7   Signal ground          From HX-3000 RS232 port
  1456.          8   Data carrier detect    From HX-3000 RS232 port
  1457.         20   Data terminal ready    To HX-3000 RS232 port
  1458.  
  1459.      The RS232C peripheral connects directly to most video
  1460.      display terminals and serial printers such as the Texas
  1461.      Instruments 99/4 Impact Printer without modification. In
  1462.      these applications the following lines are used.
  1463.          HX-3000          DATA
  1464.           RS232         TERMINAL
  1465.           PORT          EQUIPMENT
  1466.             1                1
  1467.             2                2
  1468.             3                3
  1469.             4                4
  1470.             5                5
  1471.             6                6
  1472.             7                7
  1473.             8                8
  1474.            20               20
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.                  APPENDICES
  1481.  
  1482.  
  1483.  
  1484. The Texas Instruments Telephone Coupler (modem) is
  1485. compatible with this peripheral in all respects. Other modems
  1486. may require cabling that differs slightly from the
  1487. configuration shown. If you use a modem other than Tl's,
  1488. check its manual to determine whether any wiring changes
  1489. are necessary for compatibility. In general, other devices
  1490. such as modems require the pin connections listed below.
  1491. Pin 4 is jumpered to pin 20 inside the RS232 peripheral.
  1492.     HX-3000           DATA
  1493.     RS232        COMMUNICATIONS
  1494.     PORT            EQUIPMENT
  1495.         1               1
  1496.         2               3
  1497.         3               2
  1498.         6              20
  1499.         7               7
  1500.         8               8
  1501.        20               6
  1502.  
  1503.  
  1504.  
  1505.  
  1506.    APPENDICES
  1507.  
  1508.  
  1509.  
  1510.   APPENDIX E: PARALLEL PORT CABLING
  1511.     Peripherals equipped with the parallel port option have a
  1512.     permanently-attached flat cable which is fitted with the
  1513.     Amphenol 36-pin male type of connector or its equivalent.
  1514.     These are standard parallel connectors. Twenty of the
  1515.     available pins are used. Eight lines transfer data, while two
  1516.     others carry control signals. The remaining 10 lines serve as
  1517.     signal grounds. The pins are connected as listed below.
  1518.             PIN    FUNCTION
  1519.              1      Strobe
  1520.              2      DO (least significant data bit)
  1521.              3      DI
  1522.              4      D2
  1523.              5      D3
  1524.              6      D4
  1525.              7      D5
  1526.              8      D6
  1527.              9      D7 (most significant data bit)
  1528.             10      Acknowledge
  1529.            19-28    Ground
  1530.  
  1531.     The signals on pins 1 through 9 are outputs from the parallel
  1532.     port to the printer. Acknowledge is an input to the parallel
  1533.     port from the printer.
  1534.  
  1535.     The following diagram illustrates the sequence of events that:
  1536.     occur during transmission of data from the parallel port.
  1537.     When a data byte appears at the port, the strobe (either
  1538.     positive or negative, as selected by the user) signals the
  1539.     attached printer that data is available. If the printer is ready
  1540.     to receive it  the data is transferred and processed. When the
  1541.     printer is ready to accept another byte, the acknowledge
  1542.     signal is sent back to the parallel port.
  1543.  
  1544.  
  1545.  
  1546.  
  1547.            SERVICE INFORMATION
  1548.  
  1549.  
  1550.  
  1551. SERVICE INFORMATION
  1552.  
  1553.    In Case of Difficulty
  1554.     If this peripheral or attached devices do not appear to be
  1555.     working properly, check the following.
  1556.     1. Power-Be sure that the power source is in order, the
  1557.        peripheral is plugged in, and the power switch is on. All
  1558.        peripherals must be turned on for proper operation.
  1559.     2. When connecting devices to the HX-3000 RS232 port, be
  1560.        sure the correct cable is being used. Check for loose or
  1561.        broken leads and connectors. Be sure that cables are
  1562.        plugged in securely. Some devices may require special
  1563.        cable connections (see appendix D).
  1564.     3. Software Options-Even when all devices are operating
  1565.        correctly, this peripheral can appear to malfunction if
  1566.        software options are improperly set. Check the user's
  1567.        manual of the device attached to the peripheral and verify
  1568.        that the device characteristics correspond to the options
  1569.        selected in the OPEN statement or LIST command. A
  1570.        printer built to operate at 300 baud, for instance, will not
  1571.        function if a baud rate of 1200 is chosen. In
  1572.        communications with other computers or with terminals,
  1573.        unsuitable baud rate, data bits, parity, echo, or carriage
  1574.        return settings may produce undesirable results.
  1575.     4. Attached Devices-If a device has a test or local mode,
  1576.        use it to be sure that the device is working properly when
  1577.        disconnected from the HX-3000 RS232 peripheral.
  1578.  
  1579.      If the RS232 peripheral or attached devices still do not
  1580.      appear to be working properly, first turn all power off. Next,
  1581.      disconnect this peripheral from the HEX-BUS(tm) interface and
  1582.      attached devices. Then follow the steps below.
  1583.      1. See if the computer itself is working properly. Turn on the
  1584.         computer. Enter the statement OPEN #1, "20" (or OPEN #1,
  1585.         "50" if the malfunction is associated with the parallel port
  1586.         The error message I/O error 255 #1 should appear in the
  1587.         computer display, indicating that the port named cannot be
  1588.         opened. This result is expected when the RS232 peripheral
  1589.         is not connected to the HEX-BUS interface.
  1590.  
  1591.  
  1592.            SERVICE INFORMATION
  1593.  
  1594.  
  1595.  
  1596. SERVICE INFORMATION
  1597.  
  1598.    In Case of Difficulty
  1599.     If this peripheral or attached devices do not appear to be
  1600.     working properly, check the following.
  1601.     1. Power-Be sure that the power source is in order, the
  1602.        peripheral is plugged in, and the power switch is on. All
  1603.        peripherals must be turned on for proper operation.
  1604.     2. When connecting devices to the HX-3000 RS232 port, be
  1605.        sure the correct cable is being used. Check for loose or
  1606.        broken leads and connectors. Be sure that cables are
  1607.        plugged in securely. Some devices may require special
  1608.        cable connections (see appendix D).
  1609.     3. Software Options-Even when all devices are operating
  1610.        correctly, this peripheral can appear to malfunction if
  1611.        software options are improperly set. Check the user's
  1612.        manual of the device attached to the peripheral and verify
  1613.        that the device characteristics correspond to the options
  1614.        selected in the OPEN statement or LIST command. A
  1615.        printer built to operate at 300 baud, for instance, will not
  1616.        function if a baud rate of 1200 is chosen. In
  1617.        communications with other computers or with terminals,
  1618.        unsuitable baud rate, data bits, parity, echo, or carriage
  1619.        return settings may produce undesirable results.
  1620.     4. Attached Devices-If a device has a test or local mode,
  1621.        use it to be sure that the device is working properly when
  1622.        disconnected from the HX-3000 RS232 peripheral.
  1623.  
  1624.      If the RS232 peripheral or attached devices still do not
  1625.      appear to be working properly, first turn all power off. Next,
  1626.      disconnect this peripheral from the HEX-BUS(tm) interface and
  1627.      attached devices. Then follow the steps below.
  1628.      1. See if the computer itself is working properly. Turn on the
  1629.         computer. Enter the statement OPEN #1, "20" (or OPEN #1,
  1630.         "50" if the malfunction is associated with the parallel port
  1631.         The error message I/O error 255 #1 should appear in the
  1632.         computer display, indicating that the port named cannot be
  1633.         opened. This result is expected when the RS232 peripheral
  1634.         is not connected to the HEX-BUS interface.
  1635.  
  1636.  
  1637. SERVICE INFORMATION
  1638.  
  1639.  
  1640. 2. Check that the RS232 peripheral is working properly. Refer
  1641.    to the set-up instructions and reconnect only the HX-3000
  1642.    RS232 peripheral to the HEX-BUS interface. Type the
  1643.    statement OPEN #1,"20" or OPEN #1, "50" and press [ENTER].
  1644.    The OPEN statement should disappear from the computer
  1645.    display and be replaced by a flashing cursor on the left
  1646.    side, indicating that the port named has been opened.
  1647. 3. If a device still does not work when reattached to this
  1648.    peripheral, then that unit or its cable may be faulty. Check
  1649.    the user's manual of the device for additional
  1650.    troubleshooting suggestions.
  1651. 4. If none of the above procedures correct the difficulty,
  1652.    consult the section entitled If You Have Questions or Need
  1653.    Assistance or refer to the Service Information portion of
  1654.    the User's Reference Guide.
  1655.  
  1656. Exchange Centers
  1657.  If your HX-3000 RS232 peripheral requires service and you do
  1658.  not wish to return the unit to a service facility for repair or
  1659.  replacement, you may elect to exchange the unit for a
  1660.  factory-reconditioned HX-3000 RS232 peripheral of the same
  1661.  model (or equivalent model specified by TI) by going in
  1662.  person to one of the exchange centers which have been
  1663.  established across the United States. A handling fee will be
  1664.  charged by the exchange center for in-warranty exchanges of
  1665.  the HX-3000 RS232 peripheral. Out-of-warranty exchanges will
  1666.  be charged at the rates in effect at the time of the exchange.
  1667.  Please refer to the enclosed Exchange Service listing or call
  1668.  the Consumer Relations Department for exchange fee
  1669.  information and the location of the nearest exchange center.
  1670.  
  1671.  If You Have Questions or Need
  1672. Assistance
  1673.   If you have questions concerning HX-3000 RS232 peripheral
  1674.   repair or peripheral, accessory, or software purchase, please
  1675.   call our Customer Relations Department at (800) 858-4565 (toll
  1676.   free within the contiguous United States). The operators at
  1677.   these numbers cannot provide technical assistance.
  1678.  
  1679.   For technical questions such as programming, specific
  1680.   applications  etc., you can call (806) 741-2663. Please note
  1681.   that this is not a toll-free number and collect calls cannot be
  1682.   accepted.
  1683.  
  1684.  
  1685.  
  1686.  
  1687.         SERVICE INFORMATION
  1688.  
  1689.  
  1690. As an alternative you can write to
  1691.      Consumer Relations Department
  1692.      Texas Instruments Incorporated
  1693.      P.O. Box 53
  1694.      Lubbock, Texas 79408
  1695.  
  1696. Because of the number of suggestions which come to Texas
  1697. Instruments from many sources containing both new and old
  1698. ideas, Texas Instruments will consider such suggestions only
  1699. if they are freely given to Texas Instruments. It is the policy
  1700. of Texas Instruments to refuse to receive any suggestions in
  1701. confidence. Therefore, if you wish to share your suggestions
  1702. with Texas Instruments or if you wish us to review any
  1703. BASIC language program which you have developed, please
  1704. include the following statement in your letter.
  1705.      "All of the information forwarded herewith is presented
  1706.      to Texas Instruments on a nonconfidential,
  1707.      nonobligatory basis; no relationship, confidential or
  1708.      otherwise, expressed or implied, is established with
  1709.      Texas Instruments by this presentation. Texas
  1710.      Instruments may use, copyright, distribute, publish,
  1711.      reproduce, or dispose of the information in any way
  1712.      without compensation to me."
  1713.  
  1714.  
  1715.